<?php /* Smarty version 2.6.18, created on 2016-12-14 15:20:13
         compiled from score/data.tpl.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'string_format', 'score/data.tpl.php', 126, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
<div class="content-wrapper">
    <section class="content">
        <div class="row">
            <form action="" method="get">
            <section class="col-lg-3 connectedSortable" style="padding-right:0px;">
                <div class="box box-solid">
                    <div class="box-header with-border" id="boring">
                        <div class="form-group">
                            <div class="input-group col-sm-12 col-xs-12">
                                <select class="form-control" name="grade_id" id="grade_id">
                                    <option value="">请选择年级</option>
                                    <?php $_from = $this->_tpl_vars['grade_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                    <option value="<?php echo $this->_tpl_vars['value']['grade_id']; ?>
"><?php echo $this->_tpl_vars['value']['grade_name']; ?>
</option>
                                    <?php endforeach; endif; unset($_from); ?>
                                </select>
                            </div>
                        </div>
                        
								<!--	<div class="form-group">
										<select class="form-control classfy" style="padding:0;" id="number2">
											  <option>请选择班级类别</option>
											  <option>文科</option>
											  <option>理科</option>
										</select>					  
								</div>-->
                        <div class="form-group class" style="height:100px; overflow-y:scroll;" id="number3">
                            <p>请先选择年级再选择班级</p>
                        </div>
                        <!--<button type="submit" class="form-control btn btn-default btn-xs">确 定</button>-->
                    </div>
                </div><!--box box-solid-->
                <div class="box box-solid">
                    <div class="box-header with-border">
                        <label>考试名称</label>
                        <div class="form-group">
                            <select id="sem_id" name="semester_id" class="form-control" style="padding:0;">
                                <option>请选择学年学期</option>
                                <?php $_from = $this->_tpl_vars['semester_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                <option value="<?php echo $this->_tpl_vars['value']['semester_id']; ?>
"><?php echo $this->_tpl_vars['value']['semester_name']; ?>
</option>
                                <?php endforeach; endif; unset($_from); ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <select name="exam_id" id="number33" class="form-control" style="padding:0;">
                                <option>请先选择学期</option>
                            </select>
                        </div>
                    </div>
                </div><!--box box-solid-->
                <div class="box box-solid">
                    <div class="box-header with-border">
                        <label>学生类型</label>
                        <div class="form-group">
                            <select name="student_type" class="form-control" style="padding:0;">
                                <option value="0">全部</option>
                                <option value="1">全部不含借读生</option>
                                <option value="2">全部不含转入生</option>
                                <option value="3">只计借读生</option>
                                <option value="4">只计转入生</option>
                            </select>
                        </div>
                    </div>
                </div><!--box box-solid-->
                <div class="box box-solid">
                    <div class="box-header with-border">
                        <label>科目选择</label>
                        <div class="form-group" style="padding-left:10px; height:120px; overflow-y:scroll; margin-bottom:30px;">
                            <label><input type="radio" name="subject_id" value="all"> 总分</label><br/>
                            <?php $_from = $this->_tpl_vars['subject_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                            <label><input type="radio" name="subject_id" value="<?php echo $this->_tpl_vars['value']['subject_id']; ?>
"><?php echo $this->_tpl_vars['value']['subject_name']; ?>
</label><br/>
                            <?php endforeach; endif; unset($_from); ?>
                        </div>
                        <input type="hidden" name="a" value="score.data">
                        <button type="submit" class="btn btn-primary btn-sm">统 计</button>
                        <a href="" class="btn btn-warning btn-sm">导 出</a>

                    </div>
                </div><!--box box-solid-->
            </section>
            </form>
            <section class="col-lg-9 connectedSortable">
                <div class="box box-default box-solid">

                        <div class="box-header with-border">
                            <span class="fa fa-exchange" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                            <p class="box-title">成绩分析</p>
                        </div>
                        <div class="box-body">
                            <h4 class="text-center"><?php echo $this->_tpl_vars['subject_name']; ?>
<?php echo $this->_tpl_vars['grade_name']; ?>
综合分析</h4>
                            <div style="width:100%; overflow-x:scroll;">
                                <table class="table table-bordered table-striped" id="mytable">
                                    <thead>
                                    <tr>
                                        <td>班级</td>
                                        <td>教师</td>
                                        <td>与考数</td>
                                        <td>实考数</td>
                                        <?php $_from = $this->_tpl_vars['r_level']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                        <td><?php echo $this->_tpl_vars['value']['min']; ?>
~<?php echo $this->_tpl_vars['value']['max']; ?>
</td>
                                        <?php endforeach; endif; unset($_from); ?>
                                        <td>最高分</td>
                                        <td>最低分</td>
                                        <td>平均分</td>
                                        <td>排名</td>
                                        <?php $_from = $this->_tpl_vars['r_section']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                        <td><?php echo $this->_tpl_vars['value']['name']; ?>
率</td>
                                        <?php endforeach; endif; unset($_from); ?>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php $_from = $this->_tpl_vars['class_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                    <tr>
                                        <td><?php echo $this->_tpl_vars['value']['class_name']; ?>
</td>
                                        <td><?php echo $this->_tpl_vars['value']['teacher']; ?>
</td>
                                        <td><?php echo $this->_tpl_vars['value']['all']; ?>
</td>
                                        <td><?php echo $this->_tpl_vars['value']['count']; ?>
</td>
                                        <?php $_from = $this->_tpl_vars['value']['level']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
                                        <td><?php echo $this->_tpl_vars['v']; ?>
</td>
                                        <?php endforeach; endif; unset($_from); ?>

                                        <td><?php echo $this->_tpl_vars['value']['max']; ?>
</td>
                                        <td><?php echo $this->_tpl_vars['value']['min']; ?>
</td>
                                        <td><?php echo ((is_array($_tmp=$this->_tpl_vars['value']['avg'])) ? $this->_run_mod_handler('string_format', true, $_tmp, "%.2f") : smarty_modifier_string_format($_tmp, "%.2f")); ?>
</td>
                                        <td><?php echo $this->_tpl_vars['value']['rank']+1; ?>
</td>
                                        <?php if ($this->_tpl_vars['value']['count'] > 0): ?>
                                        <?php $_from = $this->_tpl_vars['value']['section']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
                                        <td><?php echo $this->_tpl_vars['k']; ?>
率:<?php echo $this->_tpl_vars['v']; ?>
</td>
                                        <?php endforeach; endif; unset($_from); ?>
                                        <?php else: ?>
                                        <?php $_from = $this->_tpl_vars['value']['section']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
                                        <td></td>
                                        <?php endforeach; endif; unset($_from); ?>
                                        <?php endif; ?>
                                    </tr>
                                    <?php endforeach; endif; unset($_from); ?>

                                    </tbody>
                                </table>
                                <p>注意：<?php $_from = $this->_tpl_vars['r_section']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
                                            <?php echo $this->_tpl_vars['v']['name']; ?>
分数段：<?php echo $this->_tpl_vars['v']['min']; ?>
-<?php echo $this->_tpl_vars['v']['max']; ?>

                                    <?php endforeach; endif; unset($_from); ?>
                                </p>
                                <table class="table table-bordered table-striped" id="mytable">
                                    <thead>
                                    <tr>
                                        <td>班级</td>
                                        <td>最高分</td>
                                        <td>最低分</td>
                                        <td>不及格</td>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <?php $_from = $this->_tpl_vars['class_lists2']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['value']):
?>
                                    <tr>
                                        <td><?php echo $this->_tpl_vars['value']['class_name']; ?>
</td>
                                        <td><?php $_from = $this->_tpl_vars['value']['max']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['v']):
?><?php echo $this->_tpl_vars['v']['student_name']; ?>
,<?php endforeach; endif; unset($_from); ?></td>
                                        <td><?php $_from = $this->_tpl_vars['value']['min']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['v']):
?><?php echo $this->_tpl_vars['v']['student_name']; ?>
,<?php endforeach; endif; unset($_from); ?></td>
                                        <td><?php $_from = $this->_tpl_vars['value']['bad']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['v']):
?><?php echo $this->_tpl_vars['v']['student_name']; ?>
,<?php endforeach; endif; unset($_from); ?>
                                        </td>
                                    </tr>
                                    <?php endforeach; endif; unset($_from); ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="box-footer text-center">
                            <div id="chartContainer1" style="height:460px; width:80%;"></div>
                        </div>
                        <!--<div class="box-footer text-center">
                            <div id="chartContainer" style="height:460px; width:80%;"></div>
                        </div>
						-->
                    
                </div><!--box box-default box-solid-->
            </section>
        </div><!--row-->
    </section>
</div>
  <!--主要内容结束-->
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script src="static/js/jQuery-2.2.0.min.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/app.min.js"></script>
<script src="static/js/demo.js"></script>
<script src="static/js/jquery-ui.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#grade_id").change(function () {
            if ($(this).val() == "-1") {
                $("#industr").remove(); return;
            }
            else {
                var timestamp = new Date().getTime();
                $.ajax({
                    url:"index.php?a=student.gradelistjson",
                    type:"get",
                    data: "grade_id=" + $("#grade_id").find("option:selected").val() + "&timestamp=" + timestamp,
                    dataType:"json",
                    success:function(msg){
//                        <label><input type="checkbox" name="allChecked" id="allChecked" onclick="DoCheck()"> 全选 </label><br/>
//                            <label><input type="checkbox" name="nian[]"> 初一2班（文科班） </label><br/>
                        //实例2个字符串变量来拼接下拉列表
                        var industr = "";
                        //使用jquery解析json中的数据
                        $.each(msg, function (n, value) {
                            industr += ("<label><input type='checkbox' name='nian[]' value=\"" + value.class_id + "\">" + value.class_name);
                            industr += ("</label><br/>");
                        });
                        var top = "<label><input type='checkbox' name='allChecked' id='allChecked' onclick='DoCheck()'> 全选 </label><br/>"
                        $("#number3").html(top+industr);
                    }
                });

            }

        });

    });
</script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#sem_id").change(function () {
            if ($(this).val() == "-1") {
                $("#industr2").remove(); return;
            }
            else {
                var timestamp = new Date().getTime();
                $.ajax({
                    url:"index.php?a=score.semjson",
                    type:"get",
                    data: "sem_id=" + $("#sem_id").find("option:selected").val() + "&timestamp=" + timestamp,
                    dataType:"json",
                    success:function(msg){

                        //实例2个字符串变量来拼接下拉列表
                        var industr = "";
                        //使用jquery解析json中的数据
                        $.each(msg, function (n, value) {
                            industr += ("<option value=\"" + value.exam_id + "\">" + value.exam_name);
                            industr += ("</option>");
                        });

                        $("#number33").html(industr);
                    }
                });

            }

        });

    });
</script>
<script type="text/javascript">
    $(document).ready(function () {

        $("#number1").change(function () {
            if ($(this).val() == "-1") {
                $("#industr").remove(); return;
            }
            else {
                var timestamp = new Date().getTime();
                $.ajax({
                    url:" ",
                    type:"get",
                    data: $("#number1").find("option:selected").val() + "&timestamp=" + timestamp,
                    dataType:"json",
                    success:function(msg){

                        //实例2个字符串变量来拼接下拉列表
                        var industr = "";
                        //使用jquery解析json中的数据
                        $.each(msg, function (n, value) {
                            industr += ("<option value=\"" + value.student_id + "\">" + value.student_id);
                            industr += ("</option>");
                        });

                        $("#number3").html(industr);
                    }
                });

            }

        });

    });
</script>
<script src="static/js/canvasjs.min.js"></script>
<?php $_from = $this->_tpl_vars['class_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
<script type="text/javascript">
    window.onload = function () {
        var charts = new CanvasJS.Chart("chartContainer1", {
            title: {
                text: "年级及班级分数段柱形图",
                fontSize: 18,
            },
            data: [{
                type: "column",
                dataPoints: [
                    <?php $_from = $this->_tpl_vars['value']['level']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['foo'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['foo']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
        $this->_foreach['foo']['iteration']++;
?>
            { y: <?php if ($this->_tpl_vars['v']): ?><?php echo $this->_tpl_vars['v']; ?>
<?php else: ?>0<?php endif; ?>, label: "<?php echo $this->_tpl_vars['r_level'][$this->_foreach['foo']['iteration']]['min']; ?>
-<?php echo $this->_tpl_vars['r_level'][$this->_foreach['foo']['iteration']]['max']; ?>
", indexLabel: "<?php if ($this->_tpl_vars['v']): ?><?php echo $this->_tpl_vars['v']; ?>
<?php else: ?>0<?php endif; ?>" },
            <?php endforeach; endif; unset($_from); ?>
//                    { y: <?php echo $this->_tpl_vars['value']['count1']; ?>
, label: "150-135", indexLabel: "<?php if ($this->_tpl_vars['value']['count1']): ?><?php echo $this->_tpl_vars['value']['count1']; ?>
<?php else: ?>0<?php endif; ?>" },
//                    { y: <?php echo $this->_tpl_vars['value']['count2']; ?>
, label: "135-110", indexLabel: "<?php if ($this->_tpl_vars['value']['count2']): ?><?php echo $this->_tpl_vars['value']['count1']; ?>
<?php else: ?>0<?php endif; ?>"},
//                    { y: <?php echo $this->_tpl_vars['value']['count3']; ?>
, label: "110-90" , indexLabel: "<?php if ($this->_tpl_vars['value']['count3']): ?><?php echo $this->_tpl_vars['value']['count1']; ?>
<?php else: ?>0<?php endif; ?>"},
//                    { y: <?php echo $this->_tpl_vars['value']['count4']; ?>
, label: "90-60" , indexLabel: "<?php if ($this->_tpl_vars['value']['count4']): ?><?php echo $this->_tpl_vars['value']['count1']; ?>
<?php else: ?>0<?php endif; ?>"},
//                    { y: <?php echo $this->_tpl_vars['value']['count5']; ?>
, label: "60-0" , indexLabel: "<?php if ($this->_tpl_vars['value']['count5']): ?><?php echo $this->_tpl_vars['value']['count1']; ?>
<?php else: ?>0<?php endif; ?>"},
                ]
            }]
        });
        charts.render();
    }
</script>
<?php endforeach; endif; unset($_from); ?>
<!--<script type="text/javascript">
    jQuery(window).load(function ($) {
        $script.ready(['CanvasJS'], function () {
            var chart = new CanvasJS.Chart("chartContainer",
                {
                    title: {
                        text: "2016-2017第二学期期中数学初一级数学综合分析",
                        fontSize: 18
                    },

                    data: [
                        {
                            type: "stackedColumn100",
                            name: "优率",
                            showInLegend: true,
                            dataPoints: [
                                { y: 40, label: "101" },
                                { y: 10, label: "102" },
                                { y: 72, label: "103" },
                                { y: 30, label: "104" },
                                { y: 21, label: "105" },
                                { y: 21, label: "106" }
                            ]
                        }, {
                            type: "stackedColumn100",
                            name: "良率",
                            showInLegend: true,
                            /*color: "green ",*/
                            dataPoints: [
                                { y: 20, label: "101" },
                                { y: 14, label: "102" },
                                { y: 40, label: "103" },
                                { y: 43, label: "104" },
                                { y: 13, label: "105" },
                                { y: 21, label: "106" }
                            ]
                        },{
                            type: "stackedColumn100",
                            name: "合格率",
                            showInLegend: true,
                            dataPoints: [
                                { y: 20, label: "101" },
                                { y: 10, label: "102" },
                                { y: 72, label: "103" },
                                { y: 30, label: "104" },
                                { y: 21, label: "105" },
                                { y: 13, label: "106" }
                            ]
                        }, {
                            type: "stackedColumn100",
                            name: "不及格率",
                            showInLegend: true,
                            dataPoints: [
                                { y: 20, label: "101" },
                                { y: 14, label: "102" },
                                { y: 40, label: "103" },
                                { y: 43, label: "104" },
                                { y: 11, label: "105" },
                                { y: 24, label: "106" }
                            ]
                        },
                    ]
                });

            chart.render();
        });
    });
</script>-->
<script>
    //checbox全选  
    function DoCheck()
    {
        var ch=document.getElementsByName("nian[]");
        if(document.getElementsByName("allChecked")[0].checked==true)
        {
            for(var i=0;i<ch.length;i++)
            {
                ch[i].checked=true;
            }
        }else{
            for(var i=0;i<ch.length;i++)
            {
                ch[i].checked=false;
            }
        }
    }
</script>